package com.xuyuan.thread.util;

import com.xuyuan.util.ConsoleColors;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ExecutorTest {
    public static void main(String[] args) throws Exception {
        ExecutorService executor = Executors.newFixedThreadPool(5);
        Future<Integer> result = executor.submit(() -> 1);
        System.out.println(ConsoleColors.RED + result.get() + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED + "today is a beautiful day" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED_BACKGROUND + "today is a beautiful day" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED_BOLD + "today is a beautiful day" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED_BRIGHT + "today is a beautiful day" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED_UNDERLINED + "today is a beautiful day" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED_BACKGROUND_BRIGHT + "today is a beautiful day" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED_BOLD_BRIGHT + "today is a beautiful day" + ConsoleColors.RESET);
        executor.shutdown();
    }
}
